<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 对象解构
    const obj = {
      uname: 'pink老师',
      age: 18
    }

    // 解构的语法
    const {uname,age} = obj
    console.log(uname,age)
    // 1. 对象解构的变量名 可以重新改名  旧变量名: 新变量名
    
    // 2. 解构数组对象
    const pig = [
      {
        uname: '佩奇',
        age: 6
      }
    ]
  </script>
</body>

</html>